package com.yuanhua.xcxmng.wechat.service.impl;

import com.yuanhua.xcxmng.wechat.entity.UserLocation;
import com.yuanhua.xcxmng.wechat.mapper.UserLocationMapper;
import com.yuanhua.xcxmng.wechat.service.BaseService;
import com.yuanhua.xcxmng.wechat.service.LocationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LocationServiceImpl extends BaseService implements LocationService {

    @Autowired
    private UserLocationMapper userLocationMapper;

    @Override
    public int deleteByPrimaryKey(Long id) {
        return userLocationMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(UserLocation record) {
        try {
            return userLocationMapper.insert(record);
        } catch (Exception e) {
            logger.error(e,e.getMessage());
            throw e;
        }
    }

    @Override
    public int insertSelective(UserLocation record) {
        try {
            return userLocationMapper.insertSelective(record);
        } catch (Exception e) {
            logger.error(e,e.getMessage());
            throw e;
        }
    }

    @Override
    public UserLocation selectByPrimaryKey(Long id) {
        try {
            return userLocationMapper.selectByPrimaryKey(id);
        } catch (Exception e) {
            logger.error(e,e.getMessage());
            throw e;
        }
    }

    @Override
    public int updateByPrimaryKeySelective(UserLocation record) {
        try {
            return userLocationMapper.updateByPrimaryKeySelective(record);
        } catch (Exception e) {
            logger.error(e,e.getMessage());
            throw e;
        }
    }

    @Override
    public int updateByPrimaryKey(UserLocation record) {
        try {
            return userLocationMapper.updateByPrimaryKey(record);
        } catch (Exception e) {
            logger.error(e,e.getMessage());
            throw e;
        }
    }
}
